﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="register.aspx.cs" Inherits="HFWebApp.lawyeruser.register" %>
<%@ Register src="../Control/top.ascx" tagname="top" tagprefix="uc1" %>
<%@ Register src="../Control/end.ascx" tagname="end" tagprefix="uc2" %>
<%@ Register src="../Control/c_LawyerRegAffairsClass.ascx" tagname="c_LawyerRegAffairsClass" tagprefix="uc3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>红法网</title>
<link href="<%=this.getDemain %>/Style/Style.css" rel="stylesheet" type="text/css" />
<link href="<%=this.getDemain %>/CSS.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=this.getDemain %>/javascript/SwitchTags.js"></script>
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/WebFunction.js"></script>
    <script type="text/javascript">
        $(function () {
            loadProvince('provinceid', 'cityid');
        });

        function Reg() {
            var uid = $("#reg_uid");
            if (uid.val() == "") {
                alert("帐号不能为空");
                uid.focus();
                return false;
            }
            var pwd = $("#reg_pwd");
            if (pwd.val() == "") {
                alert("密码不能为空");
                pwd.focus();
                return false;
            }
            var pwd2 = $("#reg_pwd2");
            if (pwd2.val() == "") {
                alert("验证密码不能为空");
                pwd2.focus();
                return false;
            }
            if (pwd.val() != pwd2.val()) {
                alert("两次输入的密码不一致");
                pwd2.focus();
                return false;
            }
            var realname = $("#reg_realname");
            if (realname.val() == "") {
                alert("真实姓名不能为空");
                realname.focus();
                return false;
            }
            var bdate_y = $("#reg_bdate_y");
            if (bdate_y.val() == "0") {
                alert("请选择出生年份");
                bdate_y.focus();
                return false;
            }
            var bdate_m = $("#reg_bdate_m");
            if (bdate_m.val() == "0") {
                alert("请选择出生月份");
                bdate_m.focus();
                return false;
            }
            var bdate_d = $("#reg_bdate_d");
            if (bdate_d.val() == "0") {
                alert("请选择出生日期");
                bdate_d.focus();
                return false;
            }
            var email = $("#reg_email");
            if (email.val() == "") {
                alert("请填写Email");
                email.focus();
                return false;
            }
            var chkEmail = new RegExp(/\w@\w*\.\w/);
            if (!chkEmail.exec(email.val())) {
                alert("Email格式不正确");
                email.focus();
                return false;
            }
            var phone = $("#reg_phone");
            if (phone.val() == "") {
                alert("请填写您的联系电话");
                phone.focus();
                return false;
            }
            var mobile = $("#reg_mobile");
            if (mobile.val() == "") {
                alert("请填写您的业务手机");
                mobile.focus();
                return false;
            }
            var provinceid = $("#provinceid");
            if (provinceid.val() == "0") {
                alert("请选择您所在的省");
                provinceid.focus();
                return false;
            }
            var cityid = $("#cityid");
            if (cityid.val() == "0") {
                alert("请选择您所在的城市");
                cityid.focus();
                return false;
            }
            var address = $("#reg_address");
            if (address.val() == "") {
                alert("请填写您的联系地址");
                address.focus();
                return false;
            }
            var post = $("#reg_post");
            if (post.val() == "") {
                alert("请填写邮编");
                post.focus();
                return false;
            }
            var fax = $("#reg_fax");
            if (fax.val() == "") {
                alert("请填写您的传真");
                fax.focus();
                return false;
            }
            var website = $("#reg_website");
            if (website.val() == "") {
                alert("请填写您的网站地址");
                website.focus();
                return false;
            }
            var lawyerno = $("#reg_lawyerno");
            if (lawyerno.val() == "") {
                alert("请填写您的律师证号码");
                lawyerno.focus();
                return false;
            }
            var lawyerfirm = $("#reg_lawyerfirm"); //律师事务所
            if (lawyerfirm.val() == "") {
                alert("请填写您所在的律师事务所");
                lawyerfirm.focus();
                return false;
            }
            var language = $("#reg_language"); //擅长语言
            if (language.val() == "") {
                alert("请填写您擅长的语言");
                language.focus();
                return false;
            }
            var content = $("#reg_content"); //简介
            if (content.val() == "") {
                alert("请填写您的简介");
                content.focus();
                return false;
            }

            var limitCount = 10;
            var selectCount = 0;
            var f = document.getElementById('lawyerRegForm');
            var cids = [];
            var nodelist = f["Areas"];  // cid[]为checkbox的name属性
            var AreasList = "";
            for (var i = 0; i < nodelist.length; i++) {
                if (nodelist[i].checked) {
                    selectCount++;
                }
            }
            if (selectCount > limitCount) {
                alert("您只能选择10个专长领域");
                return false;
            }
            if (selectCount == 0) {
                alert("您必须选择至少1个专长领域");
                return false;
            }

            for (var i = 0; i < nodelist.length; i++) {
                if (nodelist[i].checked) {
                    if (AreasList == "") {
                        AreasList = nodelist[i].value;
                    } else {
                        AreasList = AreasList + "|" + nodelist[i].value;
                    }
                }
            }

            var sex = $("#reg_sex").val();
            var url = "/AjaxSource/LawyerReg.ashx";

            //调用注册接口
            $.getJSON(
                url,
                { uid: uid.val(),
                  pwd: pwd.val(),
                  pwd2: pwd2.val(),
                  realname: realname.val(),
                  bdate: bdate_y.val() + "-" + bdate_m.val() + "-" + bdate_d.val(),
                  email: email.val(),
                  phone: phone.val(),
                  mobile: mobile.val(),
                  provinceid: provinceid.val(),
                  cityid: cityid.val(),
                  address: address.val(),
                  post: post.val(),
                  fax: fax.val(),
                  website: website.val(),
                  lawyerno: lawyerno.val(),
                  lawyerfirm: lawyerfirm.val(),
                  language: language.val(),
                  content: content.val(),
                  areas: AreasList,
                  sex: sex,
                  rand: Math.floor(Math.random() * 10000).toString() },
                function (jsonData) {
                    if (jsonData.isTrue) {
                        location = jsonData.goUrl;
                    } else {
                        alert(jsonData.Message);
                    }
                }
            );

            return false;
        }
    </script>
</head>

<body>
<uc1:top ID="top1" MenuClassID="1" focusLink1="focusLink" runat="server" />
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="<%=this.getDemain %>/images/bt_lszc.jpg" width="308" height="53" /></td>
  </tr>
</table>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0" class="bk_h">
<form id="lawyerRegForm" action="" method="post" onsubmit="return Reg();">
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:10px">
      <tr>
        <td height="30" background="<%=this.getDemain %>/images/bt_bj_3.jpg"><table width="130" border="0" cellspacing="0" cellpadding="0" style="margin-left:5px">
          <tr>
            <td height="28" align="center" background="<%=this.getDemain %>/images/bt_bj_23.jpg" class="bt_b_c" style="padding-top:2px">会员登陆名和密码</td>
          </tr>
        </table></td>
      </tr>
    </table>
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="1" style="margin-bottom:12px">
        <tr>
          <td width="120" height="32" align="right" bgcolor="#E8ECEB">设置会员登录名：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_uid" id="reg_uid" />
          *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">设置密码：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="password" name="reg_pwd" id="reg_pwd" />
          *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">再次输入密码：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="password" name="reg_pwd2" id="reg_pwd2" />
          *</td>
        </tr>
    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:10px">
        <tr>
          <td height="30" background="<%=this.getDemain %>/images/bt_bj_3.jpg"><table width="130" border="0" cellspacing="0" cellpadding="0" style="margin-left:5px">
            <tr>
              <td height="28" align="center" background="<%=this.getDemain %>/images/bt_bj_23.jpg" class="bt_b_c" style="padding-top:2px">姓名和联系方式</td>
            </tr>
          </table></td>
        </tr>
    </table>
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="1" style="margin-bottom:12px">
        <tr>
          <td width="120" height="32" align="right" bgcolor="#E8ECEB">真实姓名：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_realname" id="reg_realname" />
            * (请填写您的真实姓名，不要加&quot;<span class="h_12">律师</span>&quot;)</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">性别：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="radio" name="reg_sex" id="reg_sex" value="1" checked="checked" />
            男
              <input type="radio" name="reg_sex" id="reg_sex" value="0" />
              女          
          *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">您的生日：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><select name="reg_bdate_y" id="reg_bdate_y">
            <option value="0">请选择年</option>
            <%for (int i = 1960; i < 2010; i++)
              { %>
              <option value="<%=i %>"><%=i %>年</option>
            <%} %>
          </select>
            年
            <select name="reg_bdate_m" id="reg_bdate_m">
              <option value="0">请选择月</option>
              <%for (int i = 1; i < 13; i++)
              { %>
              <option value="<%=i %>"><%=i %>月</option>
            <%} %>
            </select>
            月
            <select name="reg_bdate_d" id="reg_bdate_d">
              <option value="0">请选择日</option>
              <%for (int i = 1; i < 32; i++)
              { %>
              <option value="<%=i %>"><%=i %>日</option>
            <%} %>
            </select>
            日           
          *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">电子邮箱：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_email" id="reg_email" />
            * <span class="h_12">非常重要！</span>这是公众与您联系的首选方式，请一定填写真实。</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">联系电话：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_phone" id="reg_phone" />
            *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">业务手机：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_mobile" id="reg_mobile" />
            * 这是公众与您联系的重要方式，建议您填写。 </td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">所在地区：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><select name="provinceid" id="provinceid">
            <option value="0">=省份=</option>
          </select> <select name="cityid" id="cityid">
            <option value="0">=城市=</option>
          </select>
            *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">街道地址：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_address" id="reg_address" />
            * 填写区、街道、门牌号 </td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">邮政编码：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_post" id="reg_post" />
            *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">传真：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_fax" id="reg_fax" />
            *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">律师网站：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_website" id="reg_website" />
            * (前面注意加&quot;http://&quot; )</td>
        </tr>
    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:10px">
        <tr>
          <td height="30" background="<%=this.getDemain %>/images/bt_bj_3.jpg"><table width="130" border="0" cellspacing="0" cellpadding="0" style="margin-left:5px">
            <tr>
              <td height="28" align="center" background="<%=this.getDemain %>/images/bt_bj_23.jpg" class="bt_b_c" style="padding-top:2px">律师介绍</td>
            </tr>
          </table></td>
        </tr>
    </table>
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="1" style="margin-bottom:12px">
        <tr>
          <td width="120" height="32" align="right" bgcolor="#E8ECEB">律师执业证号：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_lawyerno" id="reg_lawyerno" />
            *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">所在律师事务所：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input name="reg_lawyerfirm" type="text" id="reg_lawyerfirm" size="60" />
            *</td>
        </tr>
        <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">擅长语言：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px"><input type="text" name="reg_language" id="reg_language" />
            *</td>
        </tr>
         <tr>
          <td height="32" align="right" bgcolor="#E8ECEB">律师简介：</td>
          <td bgcolor="#E8ECEB" style="padding-left:12px; padding-bottom:8px ; padding-top:8px" ><textarea name="reg_content" id="reg_content" cols="50" rows="5"></textarea>           
           *</td>
        </tr>
    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:10px">
        <tr>
          <td height="30" background="<%=this.getDemain %>/images/bt_bj_3.jpg"><table width="130" border="0" cellspacing="0" cellpadding="0" style="margin-left:5px">
            <tr>
              <td height="28" align="center" background="<%=this.getDemain %>/images/bt_bj_23.jpg" class="bt_b_c" style="padding-top:2px">专长领域(限10项)</td>
            </tr>
          </table></td>
        </tr>
    </table>
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="0" class="bt_bj_22">
        <tr>
          <td height="30" class="bt_h_14" style="padding-left:12px">民事类法律事务</td>
        </tr>
      </table>
      <div style="width:718px; overflow:hidden; margin-left:auto; margin-right:auto;" class="bk_xzy">
            <uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass1" LegalAffairID="1"  runat="server" />
      </div>
      
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="0" class="bt_bj_22">
        <tr>
          <td height="30" class="bt_h_14" style="padding-left:12px">经济类法律事务</td>
        </tr>
      </table>
      <div style="width:718px; overflow:hidden; margin-left:auto; margin-right:auto;" class="bk_xzy">
            <uc3:c_LawyerRegAffairsClass LegalAffairID="2"  ID="c_LawyerRegAffairsClass2" runat="server" />
      </div>

      <table width="720" border="0" align="center" cellpadding="0" cellspacing="0" class="bt_bj_22">
        <tr>
          <td height="30" class="bt_h_14" style="padding-left:12px">刑事行政法律事务</td>
        </tr>
      </table>
      <div style="width:718px; overflow:hidden; margin-left:auto; margin-right:auto;" class="bk_xzy">
            <uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass3" LegalAffairID="3"  runat="server" />
      </div>
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="0" class="bt_bj_22">
        <tr>
          <td height="30" class="bt_h_14" style="padding-left:12px">涉外法律事务</td>
        </tr>
      </table>
      <div style="width:718px; overflow:hidden; margin-left:auto; margin-right:auto;" class="bk_xzy">
            <uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass4" LegalAffairID="4"  runat="server" />
      </div>
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="0" class="bt_bj_22">
        <tr>
          <td height="30" class="bt_h_14" style="padding-left:12px">公司专项法律服务</td>
        </tr>
      </table>
      <div style="width:718px; overflow:hidden; margin-left:auto; margin-right:auto;" class="bk_xzy">
            <uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass5" LegalAffairID="5"  runat="server" />
      </div>
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="0" class="bt_bj_22">
        <tr>
          <td height="30" class="bt_h_14" style="padding-left:12px">其他非讼法律事务</td>
        </tr>
      </table>
      <div style="width:718px; overflow:hidden; margin-left:auto; margin-right:auto;" class="bk_xzy">
            <uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass6" LegalAffairID="6"  runat="server" />
      </div>
      <br />
    <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="40" style="padding-left:140px"><input  id="Button1" type="image" src="<%=this.getDemain %>/images/an_tj_3.jpg" />　<img src="<%=this.getDemain %>/images/an_tj_4.jpg" width="92" height="35" /></td>
        </tr>
    </table>
    </td>
  </tr>
</form>
</table>
<uc2:end ID="end1" runat="server" />
</body>
</html>
